const jwt = require("jsonwebtoken");

const secret = "TxkFzaWhS2ZWPej9pc8Am83WDGQDNHS9";
const generateToken = (value, expires) => {
    return jwt.sign(value, secret, { expiresIn: expires });
};
const verifyToken = (token) => {
    try {
        return jwt.verify(token, secret);
    } catch (error) {
        return false;
    }
};

module.exports = { verifyToken, generateToken };
